package net.seabookchen.dao;

import java.util.List;

import net.seabookchen.pojo.News;

import com.googlecode.objectify.ObjectifyService;
import com.googlecode.objectify.Query;

public class NewsDao extends ObjectifyGenericDao<News> {
	
	static {
		ObjectifyService.register(News.class);
	}

	public NewsDao(Class<News> clazz) {
		super(clazz);
	}
	
	public List<News> listNews(int index) {
		Query<News> news = ofy().query(News.class).order("-created").limit(index);
		return deadOrLive(news);
	}
	
	public List<News> listNews() {
		Query<News> news = ofy().query(News.class).order("-created");
		return deadOrLive(news);
	}

}
